        
<span id="id-config-{{$data['config']['type']}}" class="hidden">
    {{json_encode($data['config'])}}
</span>
<table class="table-data" style="width: 960px;margin-top: 0px">
    <tr>
        <th>No.</th>
        {{foreach $configs['cols'] as $col}}
        <th style="
            {{if isset($col["minw"])}}min-width: {{$col["minw"]}}px;{{/if}}
            {{if $col["type"]=="number"}}text-align: right;{{/if}}
            ">
            {{if isset($col["group"])}}
            <img style="float: left;  padding-right: 4px;
                 {{if $data['config']['group']!=$col["title"]}}
                    opacity: 0.25;cursor: pointer;
                 {{else}}
                    {{if $data['config']['sort']==""}}
                        opacity: 0.25;cursor: pointer;
                    {{/if}}
                 {{/if}}
                    " 
                 src="{{base_url()}}images/icon/stock_group_cells.png"
                 title="Group by Name"
                 onclick="product_groupby('{{$data['config']['type']}}','{{$col["title"]}}');"
                 />
            {{/if}}
            {{$col["title"]}}
        </th>
        {{/foreach}}
        <th></th>
    </tr>
    
{{if empty($data['product'])}}
    <tr><td colspan='{{count($configs['cols'])+2}}' style='text-align:center'>No data to display</td></tr>
{{else}}
    {{assign var=group value=""}}
    {{assign var=win value="0"}}
    {{foreach $data['product'] as $r}}
        {{if strtolower(str_replace(" ", "", $r['group']))!=strtolower(str_replace(" ", "", $group))}}
            {{assign var=group value=$r['group']}}
            <tr style='background:#D7D7D7'>
                <td colspan='{{count($configs['cols'])+2}}' >
                    <b>{{$data['config']['group']}} : {{$r['group']}}</b>
                </td>
            </tr>
        {{/if}}
    <tr class="id-head-row {{$data['config']['type']}}{{$r['id']}}
        {{if $win==0 and $r["sl"]==1}}
            cblue
            {{assign var=win value="1"}}
        {{/if}}
        ">
        <td>&nbsp;</td>
         {{foreach $configs['cols'] as $col}}
        
            {{if $col["field"]=="status"}}
                {{if !isset($r['delete'])}}
                <td>
                    <span class="showandhide">
                        <span class="hideifhover">
                        {{if $r['status']=="Public"}}
                            Public
                        {{else}}
                            Private
                        {{/if}}
                        </span>
                        <span class="showifhover">
                        {{if $r['status']!="Public"}}
                            <a href="javascript:statusProduct('{{$r['id']}}','Public');">Private → Public</a>
                        {{else}}
                            <a href="javascript:statusProduct('{{$r['id']}}','Private');">Public → Private</a>
                        {{/if}}
                        </span>
                    </span>
                </td>
                {{else}}
                    {{if $r['status']=="Public"}}
                        <td>Public</td>
                    {{else}}
                        <td>Private</td>
                    {{/if}}
                {{/if}}
            {{elseif $col["type"]=="datetime"}}
                <td title="{{$r[$col["field"]]}}">{{if isset($r[$col["field"]])}}{{date("Y-m-d", strtotime($r[$col["field"]]))}}{{/if}}</td>
            {{elseif $col["type"]=="number"}}
                <td style="text-align: right">{{$r[$col["field"]]}}</td>
            {{else}}
                <td>{{$r[$col["field"]]}}</td>
            {{/if}}
            
        
        {{/foreach}}
        <td></td>
        
    </tr>
    {{/foreach}}
    {{/if}}
</table>

<div class="clear"></div>
<script>
    $('.tooltip').poshytip({
        className: 'tip-yellowsimple',
        hideTimeout:0,
        alignTo: 'target',
        alignX: 'center',
        allowTipHover: false,
        hideAniDuration:0
    });
</script>